package com.cyt.sys.service.impl;

import com.cyt.sys.dao.SysRoleMenuDao;
import com.cyt.sys.model.po.SysRoleMenu;
import com.cyt.sys.service.SysRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *@Author: YuShengQiang
 *@Date: 2018-11-16 11:54
 *@Description:基础部分角色菜单service实现类
 */
@Service("baseRoleMenuService")
public class SysRoleMenuServiceImpl extends BaseServiceImpl<SysRoleMenu> implements SysRoleMenuService {

    @Resource
    private SysRoleMenuDao sysRoleMenuDao;

    @Autowired
    public void setBaseDao(SysRoleMenuDao sysRoleMenuDao) {
        this.baseDao = sysRoleMenuDao;
    }

    /**
     * 根据角色id删除
     *
     * @param roleId 角色id
     * @return
     * @author shengQiang yu
     * @date 2018-12-15 10:25
     */
    public int deleteByRoleId(String roleId){
       return sysRoleMenuDao.deleteByRoleId(roleId);
    }
    /**
     * 根据角色id获取菜单权限列表
     *
     * @param roleId 角色id
     * @return
     * @author shengQiang yu
     * @date 2018-12-15 10:25
     */
    public List<String> selectMenuIdByRoleId(String roleId){
        return sysRoleMenuDao.selectMenuIdByRoleId(roleId);
    }
}
